package com.lehecai.core.event;

import com.lehecai.core.IntegerBeanLabelItem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by zhangzq on 2015/3/4.
 */
public class EventTemplateType extends IntegerBeanLabelItem {
	private static final Logger logger = LoggerFactory.getLogger(EventTemplateType.class.getName());
	private static List<EventTemplateType> items = new ArrayList<EventTemplateType>();

	protected EventTemplateType(String name, int value) {
		super(EventTemplateType.class.getName(), name, value);
		items.add(this);
	}
	
	public static EventTemplateType getItem(int value){
		try {
			return (EventTemplateType) EventTemplateType.getResult(EventTemplateType.class.getName(), value);
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			return null;
		}
	}
	
	public static List<EventTemplateType> getItems() {
		return items;
	}

	public static final EventTemplateType ALL = new EventTemplateType("全部", -1);
	public static final EventTemplateType AWARDSEVENT = new EventTemplateType("加奖活动", 1);

}
